Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROMFS: allow list over FTP #26225

Merged
merged 5 commits into from
Feb 21, 2024
Merged

ROMFS: allow list over FTP #26225

merged 5 commits into from
Feb 21, 2024

Conversation

IamPete1
Copy link
Member

Currently scripting will try and load any scripts in the @ROMFS/scripts directory or subdirectorys. This means it will also attempt to load any modules which will fail and cause a pre-arm. This is needed for #26157 to be useful.

Tested in SITL with ROMFS_custom.

@tridge
Copy link
Contributor

tridge commented Feb 20, 2024

needs checking with AP_Filesystem and MAVFtp

@IamPete1
Copy link
Member Author

Make sure folders can be listed by returning DT_DIR/DT_REG type.

@IamPete1 IamPete1 changed the title AP_ROMFS: dir_list no longer looks in subfolders ROMFS: allow list over FTP Feb 20, 2024
@IamPete1
Copy link
Member Author

This now allows full dir listing of ROMFS. It mostly works as any other file system. The mostly part is that we get a directory for each file. For example:

ftp list @ROMFS:

Listing @ROMFS
 D models
 D models
 D models
 D models
 D models
 D scripts
 D scripts
 D scripts
   locations.txt        4187

ftp list @ROMFS/models:

Listing @ROMFS/models
   Callisto.json        1460
   plane-3d.parm        874
   plane.parm   1739
   xplane_heli.json     1935
   xplane_plane.json    1905
Total size 7.73 kByte

So we get 5 copy's of the models directory because there are 5 files in it.

To only show each directory once we would have to stash the last directory name somewhere and skip if there is no change. I'm not sure if its worth it....

@IamPete1 IamPete1 requested a review from tridge February 20, 2024 18:48
@IamPete1
Copy link
Member Author

Some related PRs: #21959 #23294 #19865

@tridge
Copy link
Contributor

tridge commented Feb 21, 2024

To only show each directory once we would have to stash the last directory name somewhere and skip if there is no change

we can do that in dir_list() by looking at the entry at ofs-1

@tridge
Copy link
Contributor

tridge commented Feb 21, 2024

@tridge tridge merged commit feff639 into ArduPilot:master Feb 21, 2024
92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants